
<template>
  <div class="page-container">
    <!--面包屑-->
    <div class="breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>会员中心</el-breadcrumb-item>
        <el-breadcrumb-item>会员等级管理</el-breadcrumb-item>
        <el-breadcrumb-item>基础设置</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <el-form  :model="dataForm" >
      <el-row class="search-input">
      <el-form-item label="每日获取成长值上限：" prop="growthDayMax" class="mb100">
        <el-input
          class="input"
          v-model.trim="dataForm.growthDayMax"
          oninput="value=value.replace(/[^\d]/g,'')"
          maxlength="5"
          placeholder="请输入数字"
          clearable
        ></el-input>成长值
      </el-form-item>
      </el-row>
      <el-form-item>
        <el-button type="primary" @click="hide" plain class="btn">取 消</el-button>
        <el-button type="primary" @click="onSubmit(dataForm)"  class="btn">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import KtButton from "@/views/Core/KtButton";
export default {
  components: {
    KtButton
  },
  data() {
    return {
      dataForm: {
        growthDayMax: null
      },
      baseFilters:{
        start:1,
        limit:10
      },
    };
  },
  methods: {
    onSubmit() {
      let this_ = this;
      this.utils.request.saveGrowthMaxInfo(this_.dataForm, function(res) {
        if (res.code == "0000") {
          this_.$message({ message: "操作成功", type: "success" });
          this_.getMemberGrowthMax();
        } else {
          if (res.code == "9999") {
            this_.$message({
              message: "操作失败, " + res.msg,
              type: "error"
            });
          } else {
            this_.$message({
              message: "操作失败, ",
              type: "error"
            });
          }
        }
      });
    },
    hide() {
      let this_ = this;
      this_.dataForm.growthDayMax = null
      this_.getMemberGrowthMax();
    },
    //成长值基础查询
    getMemberGrowthMax() {
      let this_ = this;
      this_.utils.request.getMemberGrowthMax(this_.baseFilters, function(res) {
          this_.dataForm.growthDayMax = res.data.rows[0].growthDayMax
      });
    },
  },
  mounted() {
    this.getMemberGrowthMax();
  }
};
</script>
<style lang="scss" scoped>
/deep/ .input{
  width: 140px;
  margin-right: 10px;
  /deep/ .el-input__inner{
    width: 140px ;
  }
}
.mb100{
  margin-bottom: 100px;
} 
</style>



